/*
 * @Author: CQJ
 * @Date: 2022-09-16 14:43:36
 * @LastEditors: CQJ
 * @LastEditTime: 2022-09-19 13:23:01
 * @Description:
 */
import { reactive } from 'vue'
// import type { ImageTypeData } from '@/types/system/systemConfig'
//视频设置
interface VideoState {
  sync_cover: number
  put_in_time: number
  update_type: number
  random_popularity: number
  random_play: number[]
  random_score: number[]
  put_rule: number[]
  update_rule: number[]
  title_filter: string
  title_replace: string
}
//图集设置
interface ImageState {
  sync_cover: number
  put_in_time: number
  random_popularity: number
  random_play: number[]
  random_score: number[]
  put_rule: number[]
  update_rule: number[]
  title_filter: string
  title_replace: string
}
interface ArticleState {
  sync_cover: number
  put_in_time: number
  random_popularity: number
  random_play: number[]
  random_score: number[]
  put_rule: number[]
  update_rule: number[]
  title_filter: string
  title_replace: string
}
interface PersonState {
  sync_cover: number
  random_popularity: number
  random_views: number[]
  put_rule: number[]
  update_rule: number[]
  title_filter: string
  title_replace: string
}
interface ConfigState {
  activeKey: string
}

//视频状态
export const videoState = reactive<VideoState>({
  sync_cover: 1,
  put_in_time: 1,
  update_type: 1,
  random_popularity: 1,
  random_play: [0, 0],
  random_score: [0, 0],
  put_rule: [0, 2, 3],
  update_rule: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
  title_filter: '',
  title_replace: ''
})
//图集状态
export const imageState = reactive<ImageState>({
  sync_cover: 1,
  put_in_time: 1,
  random_popularity: 1,
  random_play: [],
  random_score: [],
  put_rule: [0],
  update_rule: [],
  title_filter: '',
  title_replace: ''
})
//文章状态
export const articleState = reactive<ArticleState>({
  sync_cover: 1,
  put_in_time: 1,
  random_popularity: 1,
  random_play: [],
  random_score: [],
  put_rule: [0],
  update_rule: [],
  title_filter: '',
  title_replace: ''
})
//影人状态
export const personState = reactive<PersonState>({
  sync_cover: 1,
  random_popularity: 1,
  random_views: [0, 1],
  put_rule: [],
  update_rule: [],
  title_filter: '',
  title_replace: ''
})

// 状态管理
export const configState = reactive<ConfigState>({
  activeKey: '1'
})

export const configRules = reactive({
  sync_cover: [{ required: true, message: '请选择同步封面图' }],
  put_in_time: [{ required: true, message: '请选择入库时间' }],
  update_type: [{ required: true, message: '请选择更新规则' }],
  random_popularity: [{ required: true, message: '请选择随机人气' }],
  put_rule: [{ required: true, message: '请选择入库规则' }],
  update_rule: [{ required: true, message: '请选择二次更新规则' }],
  //图集rules
  // atlasSyncCover: [{ required: true, message: '请选择同步封面图' }],
  // atlasEntryTime: [{ required: true, message: '请选择入库时间' }],
  // atlasRandomPopular: [{ required: true, message: '请选择随机人气' }],
  // atlasWarehousingRule: [{ required: true, message: '请选择入库规则' }],
  // atlasSecondUpdateRule: [{ required: true, message: '请选择二次更新规则' }],
  //文章rules
  articleSyncCover: [{ required: true, message: '请选择同步封面图' }],
  articleEntryTime: [{ required: true, message: '请选择入库时间' }],
  articleRandomPopular: [{ required: true, message: '请选择随机人气' }],
  articleWarehousingRule: [{ required: true, message: '请选择入库规则' }],
  articleSecondUpdateRule: [{ required: true, message: '请选择二次更新规则' }],
  //影人rules
  filmMakerSyncCover: [{ required: true, message: '请选择同步封面图' }],
  filmMakerRandomPopular: [{ required: true, message: '请选择随机人气' }],
  filmMakerWarehousingRule: [{ required: true, message: '请选择入库规则' }],
  filmMakerSecondUpdateRule: [{ required: true, message: '请选择二次更新规则' }]
})
export interface CommonType {
  value: number
  label: string
  disabled?: boolean
}
//视频设置
export const repeatRuleData: CommonType[] = [
  { value: 0, label: '影片名称', disabled: true },
  { value: 1, label: '分类' },
  { value: 2, label: '主演' },
  { value: 3, label: '导演' },
  { value: 4, label: '年代' },
  { value: 5, label: '地区' },
  { value: 6, label: '语言' }
]
export const secondRepeatRuleData: CommonType[] = [
  { value: 0, label: '更新时间' },
  { value: 1, label: '播放地址' },
  { value: 2, label: '线路名称' },
  { value: 3, label: '主演' },
  { value: 4, label: '导演' },
  { value: 5, label: '年代' },
  { value: 6, label: '地区' },
  { value: 7, label: '语言' },
  { value: 8, label: '完结状态' },
  { value: 10, label: '上映时间' },
  { value: 11, label: '连载集数' },
  { value: 12, label: '总集数' },
  { value: 13, label: '影片时长' },
  { value: 14, label: '豆瓣评分' },
  { value: 15, label: 'IMDB评分' },
  { value: 16, label: '影片备注' },
  { value: 17, label: '封面' },
  { value: 18, label: '简介' },
  { value: 19, label: '影片别名' },
  { value: 20, label: '影片标签' }
]
//图集设置
export const atlasRepeatRuleData: CommonType[] = [
  { value: 0, label: '图集名称', disabled: true },
  { value: 1, label: '分类' },
  { value: 2, label: '作者' }
]
export const atlasSecondRepeatRuleData: CommonType[] = [
  { value: 0, label: '图集资源' },
  { value: 1, label: '封面' },
  { value: 2, label: '图集标签' },
  { value: 3, label: '图集简介' }
]
//文章设置
export const articleRepeatRuleData: CommonType[] = [
  { value: 0, label: '文章名称', disabled: true },
  { value: 1, label: '分类' },
  { value: 2, label: '作者' }
]
export const articleSecondRepeatRuleData: CommonType[] = [
  { value: 0, label: '文章资源' },
  { value: 1, label: '封面' },
  { value: 2, label: '文章标签' },
  { value: 3, label: '文章简介' }
]

//影人设置
export const fileMakerRepeatRuleData: CommonType[] = [
  { value: 0, label: '影人名称', disabled: true },
  { value: 1, label: '分类' },
  { value: 2, label: '性别' }
]
export const fileMakerSecondRepeatRuleData: CommonType[] = [
  { value: 0, label: '影人图片' },
  { value: 1, label: '别名' },
  { value: 2, label: '英文名' },
  { value: 3, label: '地区' },
  { value: 4, label: '性别' },
  { value: 5, label: '血型' },
  { value: 6, label: '星座' },
  { value: 7, label: '身高' },
  { value: 8, label: '体重' },
  { value: 9, label: '国籍' },
  { value: 10, label: '民族' },
  { value: 11, label: '生日' },
  { value: 12, label: '出生地' },
  { value: 13, label: '职业' },
  { value: 14, label: '经纪公司' },
  { value: 15, label: '毕业院校' },
  { value: 16, label: '代表作' },
  { value: 17, label: '明星关系' },
  { value: 18, label: '影人简介' },
  { value: 19, label: '影人详情' }
]
